;6、请写一个可把两个字符串合并的示例程序

assume cs:code,ds:data

data segment 

string1 db "hello",0
string2 db "world",0
outstring db 20 dup(?)

data ends


code segment
start:
	  
	  	mov ax, data
		mov ds, ax
		mov ax, offset string1
		mov si, ax
		sub si, 1
		mov ax, offset outstring
		mov di, ax
	;
judge1:
		inc si
		cmp byte ptr[si], 0
		jz deal
		mov al, [si]
		mov [di], al
		inc di
		jmp judge1
		;将第一个字符串合并
		
		

judge2:		
		inc si
		cmp byte ptr[si], 0
		jz 	ad
		mov al, [si]
		mov [di], al
		inc di
		jmp judge2
		;合并第二个字符串
		
deal:
		mov ax, offset string2
		mov si, ax
		sub si, 1
		jmp judge2
		

ad:		mov byte ptr [di], 0
		;添加结束标志 0
				
exit:
		mov ax, 4c00h
		int 21h





code ends